/**
*  deferredconfirm.cpp
*
*  @copyright 2016
*/

/**
*  Dependencies
*/
#include "deferredconfirm.h"
#include "basicackframe.h"
#include "basicnackframe.h"

/**
*  Start namespace
*/
namespace AMQP {

	/**
	*  Process the ack
	*
	*  @param  frame   The frame to process
	*/
	void DeferredConfirm::process(BasicAckFrame* frame)
	{
		// call the ack callback
		if (_ackCallback)  _ackCallback(frame->deliveryTag(), frame->multiple(), true);
	}

	/**
	*  Process the nack
	*
	*  @param  frame   The frame to process
	*/
	void DeferredConfirm::process(BasicNackFrame* frame)
	{
		// call the ack callback
		if (_ackCallback)  _ackCallback(frame->deliveryTag(), frame->multiple(), false);
	}
}
